package binary;
/** 补码 */
public class ComplementDemo {
    public static void main(String[] args) {
        //规律数:
        /*
        int max = Integer.MAX_VALUE;
        int min = Integer.MIN_VALUE;
        System.out.println(Integer.toBinaryString(max));//0111...
        System.out.println(Integer.toBinaryString(min));//1000...
        System.out.println(Integer.toBinaryString(-1));//1111...
         */

        int n = -45;
        System.out.println(Integer.toBinaryString(n));//11111111111111111111111111010011
        System.out.println(n);;
    }
}
